@zonos/elements 1.3.89 → 1.3.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (83) hide show
  1. package/dist/cjs/{cart-e15290ab.js → cart-3cc424f9.js} +14 -9
  2. package/dist/cjs/{createCustomEvent-3da45800.js → createCustomEvent-68a5819f.js} +1 -1
  3. package/dist/cjs/index.cjs.js +7 -7
  4. package/dist/cjs/{paypal-47b71e3b.js → paypal-6abc29b9.js} +1 -5
  5. package/dist/cjs/zonos-address_7.cjs.entry.js +1 -1
  6. package/dist/cjs/zonos-cart-items_12.cjs.entry.js +10 -14
  7. package/dist/cjs/zonos-checkout.cjs.entry.js +3 -3
  8. package/dist/cjs/zonos-controller.cjs.entry.js +1 -1
  9. package/dist/cjs/zonos-country-flag.cjs.entry.js +1 -1
  10. package/dist/cjs/zonos-country-select_4.cjs.entry.js +1 -1
  11. package/dist/cjs/zonos-hello-dialog.cjs.entry.js +1 -1
  12. package/dist/cjs/zonos-hello.cjs.entry.js +1 -1
  13. package/dist/cjs/zonos-language-select_2.cjs.entry.js +1 -1
  14. package/dist/cjs/zonos-notification_3.cjs.entry.js +2 -2
  15. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-finish/zonos-checkout-finish.js +4 -4
  16. package/dist/collection/components/checkout/zonos-checkout/zonos-checkout-payment/zonos-checkout-payment.js +1 -5
  17. package/dist/collection/components/checkout/zonos-checkout/zonos-shipping/zonos-shipping.js +3 -3
  18. package/dist/collection/components/store/checkout/cart.js +15 -10
  19. package/dist/esm/{cart-08c2a740.js → cart-66d67627.js} +14 -9
  20. package/dist/esm/{createCustomEvent-a8a9fe09.js → createCustomEvent-34725327.js} +1 -1
  21. package/dist/esm/index.js +7 -7
  22. package/dist/esm/{paypal-4a21792c.js → paypal-da9e020f.js} +2 -5
  23. package/dist/esm/zonos-address_7.entry.js +1 -1
  24. package/dist/esm/zonos-cart-items_12.entry.js +10 -14
  25. package/dist/esm/zonos-checkout.entry.js +3 -3
  26. package/dist/esm/zonos-controller.entry.js +1 -1
  27. package/dist/esm/zonos-country-flag.entry.js +1 -1
  28. package/dist/esm/zonos-country-select_4.entry.js +1 -1
  29. package/dist/esm/zonos-hello-dialog.entry.js +1 -1
  30. package/dist/esm/zonos-hello.entry.js +1 -1
  31. package/dist/esm/zonos-language-select_2.entry.js +1 -1
  32. package/dist/esm/zonos-notification_3.entry.js +2 -2
  33. package/dist/esm-es5/{cart-08c2a740.js → cart-66d67627.js} +1 -1
  34. package/dist/esm-es5/{createCustomEvent-a8a9fe09.js → createCustomEvent-34725327.js} +1 -1
  35. package/dist/esm-es5/index.js +1 -1
  36. package/dist/esm-es5/{paypal-4a21792c.js → paypal-da9e020f.js} +2 -2
  37. package/dist/esm-es5/zonos-address_7.entry.js +1 -1
  38. package/dist/esm-es5/zonos-cart-items_12.entry.js +1 -1
  39. package/dist/esm-es5/zonos-checkout.entry.js +1 -1
  40. package/dist/esm-es5/zonos-controller.entry.js +1 -1
  41. package/dist/esm-es5/zonos-country-flag.entry.js +1 -1
  42. package/dist/esm-es5/zonos-country-select_4.entry.js +1 -1
  43. package/dist/esm-es5/zonos-hello-dialog.entry.js +1 -1
  44. package/dist/esm-es5/zonos-hello.entry.js +1 -1
  45. package/dist/esm-es5/zonos-language-select_2.entry.js +1 -1
  46. package/dist/esm-es5/zonos-notification_3.entry.js +1 -1
  47. package/dist/scripts/index.js +1 -1
  48. package/dist/scripts/loadZonos.js +1 -1
  49. package/dist/scripts/zonos.js +1 -1
  50. package/dist/zonos-elements/assets/RemoveIcon.svg +1 -1
  51. package/dist/zonos-elements/index.esm.js +1 -1
  52. package/dist/zonos-elements/{p-dbd51a62.system.entry.js → p-03159bbf.system.entry.js} +1 -1
  53. package/dist/zonos-elements/{p-3ac3a8be.entry.js → p-06bab7d2.entry.js} +1 -1
  54. package/dist/zonos-elements/{p-49010cea.system.entry.js → p-072f4a48.system.entry.js} +1 -1
  55. package/dist/zonos-elements/{p-3214b2df.js → p-0af823af.js} +1 -1
  56. package/dist/zonos-elements/{p-48b151ae.entry.js → p-0deebb7a.entry.js} +1 -1
  57. package/dist/zonos-elements/{p-6d5d31ac.entry.js → p-14783646.entry.js} +1 -1
  58. package/dist/zonos-elements/{p-0033c20b.system.entry.js → p-14d2312c.system.entry.js} +1 -1
  59. package/dist/zonos-elements/{p-9773abc9.entry.js → p-1615c1c4.entry.js} +1 -1
  60. package/dist/zonos-elements/{p-4f13a851.entry.js → p-2e00dbf9.entry.js} +1 -1
  61. package/dist/zonos-elements/{p-3951ac01.entry.js → p-324fd0ad.entry.js} +1 -1
  62. package/dist/zonos-elements/{p-00706ef7.system.js → p-35d1a532.system.js} +1 -1
  63. package/dist/zonos-elements/{p-db4c833d.js → p-5cbae38e.js} +2 -2
  64. package/dist/zonos-elements/{p-12f25739.system.entry.js → p-6525fa0e.system.entry.js} +1 -1
  65. package/dist/zonos-elements/p-6c6eb676.entry.js +1 -0
  66. package/dist/zonos-elements/{p-4a417566.system.entry.js → p-6e49e7cc.system.entry.js} +1 -1
  67. package/dist/zonos-elements/{p-f5e29ed6.system.entry.js → p-71cc7c12.system.entry.js} +1 -1
  68. package/dist/zonos-elements/{p-fc2191b7.system.entry.js → p-a637cb1c.system.entry.js} +1 -1
  69. package/dist/zonos-elements/{p-531973ca.entry.js → p-b85f701c.entry.js} +1 -1
  70. package/dist/zonos-elements/p-bd1b32ea.system.entry.js +1 -0
  71. package/dist/zonos-elements/{p-8bbe007f.system.entry.js → p-c0e66eb4.system.entry.js} +1 -1
  72. package/dist/zonos-elements/{p-7c8ad901.js → p-c61d62ec.js} +1 -1
  73. package/dist/zonos-elements/p-c78dd680.system.js +1 -1
  74. package/dist/zonos-elements/{p-05b75d37.system.js → p-d1c0bc88.system.js} +1 -1
  75. package/dist/zonos-elements/{p-5f0c4397.system.js → p-d3a8c7ae.system.js} +2 -2
  76. package/dist/zonos-elements/{p-2aeb1f26.entry.js → p-dd151786.entry.js} +1 -1
  77. package/dist/zonos-elements/{p-c1f0aeb4.system.js → p-e987ae90.system.js} +1 -1
  78. package/dist/zonos-elements/{p-76015899.system.entry.js → p-eca9ebc4.system.entry.js} +1 -1
  79. package/dist/zonos-elements/{p-aab5ccde.entry.js → p-fb85884a.entry.js} +1 -1
  80. package/dist/zonos-elements/zonos-elements.esm.js +1 -1
  81. package/package.json +1 -1
  82. package/dist/zonos-elements/p-c28824a0.system.entry.js +0 -1
  83. package/dist/zonos-elements/p-f49ca64f.entry.js +0 -1
@@ -9826,7 +9826,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
9826
9826
  cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
9827
9827
  }
9828
9828
  };
9829
- const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
9829
+ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
9830
9830
  var _a;
9831
9831
  if (landedCostId && cartStore.selectedLandedCost) {
9832
9832
  // update cart total right away if we have landed cost id to avoid order total flickering
@@ -9840,7 +9840,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
9840
9840
  }
9841
9841
  // update checkout session
9842
9842
  if (!cartStore.checkoutSessionId) {
9843
- handleFetch.logError('Could not update cart total without checkout session id');
9843
+ handleFetch.log('Could not update cart total without checkout session id', 'info');
9844
9844
  return false;
9845
9845
  }
9846
9846
  const { errors, json } = await stripeStoreUpdateCheckoutSession({
@@ -9854,13 +9854,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
9854
9854
  });
9855
9855
  if (errors.length > 0 || !json) {
9856
9856
  // do nothing if we can't get checkout session
9857
- handleFetch.logError('Error occurs when updating checkout session');
9858
- cartStoreUpdateToErrorState({
9859
- messages: [
9860
- translate("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists"),
9861
- ],
9862
- title: translate('Error updating Checkout'),
9863
- });
9857
+ handleFetch.logError('Error occurs when updating checkout session.');
9858
+ if (shouldInitSessionOnFailure) {
9859
+ handleFetch.log('Initiating checkout session on failure', 'info');
9860
+ const success = await stripeStoreInitCheckoutSession();
9861
+ handleFetch.log(`stripeStoreInitCheckoutSession: ${success}`);
9862
+ if (!success) {
9863
+ return false;
9864
+ }
9865
+ return true;
9866
+ }
9864
9867
  return false;
9865
9868
  }
9866
9869
  if (!landedCostId) {
@@ -9978,6 +9981,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
9978
9981
  currency: currency,
9979
9982
  dutiesTaxesFeesEstimate: 0,
9980
9983
  itemsAmount: total,
9984
+ // attempt to init session on failure to update checkout session
9985
+ shouldInitSessionOnFailure: true,
9981
9986
  });
9982
9987
  stripeStore.isFetchingSession = false;
9983
9988
  };
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- const cart = require('./cart-e15290ab.js');
3
+ const cart = require('./cart-3cc424f9.js');
4
4
  const zonosStore = require('./zonosStore-a4395972.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
 
@@ -97,7 +97,7 @@ const getZonosQaUrl = () => {
97
97
  return null;
98
98
  }
99
99
  const qaUrl = extractZonosQaUrl(window.location.href);
100
- const cdnUrl = "https://v1.3.89.js.zonos.com";
100
+ const cdnUrl = "https://v1.3.91.js.zonos.com";
101
101
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
102
102
  if (!qaUrl &&
103
103
  (cdnUrl.includes('test.') ||
@@ -281,10 +281,10 @@ const zonosLoadUrl = (() => {
281
281
  }
282
282
  return null;
283
283
  })();
284
- const ZONOS_URL = "https://v1.3.89.js.zonos.com";
285
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.89";
286
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.89";
287
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.89";
284
+ const ZONOS_URL = "https://v1.3.91.js.zonos.com";
285
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.91";
286
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.91";
287
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.91";
288
288
  const INTER_FONT_URL = 'https://rsms.me';
289
289
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
290
290
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -299,7 +299,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
299
299
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
300
300
  Zonos._paypalMockResponse = null;
301
301
  Zonos.isBigCommerce = false;
302
- Zonos.releaseDate = "1728924518080";
302
+ Zonos.releaseDate = "1728930718892";
303
303
  Zonos.isLegacyCheckout = false;
304
304
  /**
305
305
  * By default, the package will load from npm
@@ -307,7 +307,7 @@ Zonos.isLegacyCheckout = false;
307
307
  Zonos.isNpm = true;
308
308
  Zonos.zonosQaUrl = null;
309
309
  Zonos.zonosQaUrlApi = null;
310
- Zonos.version = `v${"1.3.89"}`;
310
+ Zonos.version = `v${"1.3.91"}`;
311
311
  Zonos.modeAlerted = false;
312
312
  Zonos.cartData = null;
313
313
  Zonos.paypal = null;
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  const zonosStore = require('./zonosStore-a4395972.js');
4
- const cart = require('./cart-e15290ab.js');
4
+ const cart = require('./cart-3cc424f9.js');
5
5
  const handleFetch = require('./handleFetch-45e76490.js');
6
6
  const isDarkColor = require('./isDarkColor-5efc8367.js');
7
7
 
@@ -448,14 +448,10 @@ const paypalStoreInitButtons = (props) => {
448
448
  .filter(Boolean);
449
449
  return paypalStore.paypalButtons;
450
450
  };
451
- const paypalStoreHasPaypalEnabled = () => {
452
- return !!paypalStore.paypalButtons.length;
453
- };
454
451
 
455
452
  exports.isContrastColor = isContrastColor;
456
453
  exports.paypalInitScript = paypalInitScript;
457
454
  exports.paypalStore = paypalStore;
458
- exports.paypalStoreHasPaypalEnabled = paypalStoreHasPaypalEnabled;
459
455
  exports.paypalStoreInitButtons = paypalStoreInitButtons;
460
456
  exports.paypalStoreReset = paypalStoreReset;
461
457
  exports.submitGtag = submitGtag;
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  const containsNonLatinChars = require('./containsNonLatinChars-2be5129b.js');
@@ -3,11 +3,11 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const paypal = require('./paypal-47b71e3b.js');
8
+ const paypal = require('./paypal-6abc29b9.js');
9
9
  const zonosStore = require('./zonosStore-a4395972.js');
10
- const createCustomEvent = require('./createCustomEvent-3da45800.js');
10
+ const createCustomEvent = require('./createCustomEvent-68a5819f.js');
11
11
  const getBorderRadius = require('./getBorderRadius-5a64574c.js');
12
12
  const handleFetch = require('./handleFetch-45e76490.js');
13
13
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
@@ -1288,9 +1288,9 @@ const ZonosCheckoutFinish = class {
1288
1288
  };
1289
1289
  // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
1290
1290
  this.getPullOrder = async (attempts = 0) => {
1291
- var _a, _b, _c;
1291
+ var _a, _b;
1292
1292
  const { baseUrl, order } = await this.pullOrder();
1293
- const legacyOrderNumberExist = !!((_c = (_b = (_a = this.order) === null || _a === void 0 ? void 0 : _a.references) === null || _b === void 0 ? void 0 : _b.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _c === void 0 ? void 0 : _c.value);
1293
+ const legacyOrderNumberExist = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
1294
1294
  // legacy customers are still using the old order number so we need to wait for legacy order number to attach to dgs order before redirecting
1295
1295
  if ((order && attempts >= 5) || legacyOrderNumberExist) {
1296
1296
  if (!legacyOrderNumberExist) {
@@ -1446,11 +1446,11 @@ const ZonosCheckoutFinish = class {
1446
1446
  var _a, _b;
1447
1447
  const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || getGraphQlShortId((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
1448
1448
  const isTestMode = createCustomEvent.getIsTestMode();
1449
- return (index.h(index.Host, { key: '3c6c69c59622b7b2731f9bc6eb1cc8a7f3491572', class: "zonos--checkout-finish zonos--elements", style: {
1449
+ return (index.h(index.Host, { key: 'b39124e58c4b12acbd7b29290808248298239e9c', class: "zonos--checkout-finish zonos--elements", style: {
1450
1450
  '--border-radius': getBorderRadius.getBorderRadius({
1451
1451
  overrideBorderStyle: this.borderRadius,
1452
1452
  }),
1453
- } }, this.isLoading && (index.h("div", { key: '45ce0e608dca725237abc09295656c8b6471d26c', class: "loading-wrapper" }, index.h("zonos-spinner", { key: 'fd1a193d34ecf41af9bb6eff082c192c6a8d46db' }))), !this.isLoading && (index.h("div", { key: '64f652a419330967f13b9d01a172fcc52f6dfd5b', class: "zonos--finish-details" }, index.h("div", { key: '945cb9e55b418de79921c1995604572e6e009459', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '241bd7034c5ab5e83e4cedd526a181120a743ad0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (index.h("div", { key: '959595c1be3f65aa6cd2e00e4398c5bb4df702b6', class: "zonos--order-number" }, "Order #", orderId)), index.h("zonos-text", { key: 'a23dce69391c3abf49eb512e715af454c971977e', textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), index.h("zonos-button", { key: 'ce87734e2d46e8a044bc0ded7a6ed6a4a705685d', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cart.cartStore.step === 'finish' && (index.h("div", { key: 'a46cee8819c83fb76a54dbe049ee2452b7fc150a', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: '514fdff77f5aff9f4b9657a0579ab843833af7b0', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: '59630cf7504c1ef9d24854d041b063bbfdc3a1a4', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
1453
+ } }, this.isLoading && (index.h("div", { key: 'e63389c86a1bb0c405e7ae3c852fc1c966320f50', class: "loading-wrapper" }, index.h("zonos-spinner", { key: '0caff7b42ab138ad47f4683ea9641b2fef75f714' }))), !this.isLoading && (index.h("div", { key: 'e305f1c720418a22a376807f17413fa97688af86', class: "zonos--finish-details" }, index.h("div", { key: 'dced8dc9e0a7ae68e4bfa6b00d841ba4eae9e1f3', class: "zonos--group" }, this.notificationType === 'success' ? (index.h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (index.h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), index.h("zonos-text", { key: '343dade4f02efe9c9fdc4c8087b725f2d4e39177', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (index.h("div", { key: 'aa715a39e3126d7cb108c447fb2eb586279fc768', class: "zonos--order-number" }, "Order #", orderId)), index.h("zonos-text", { key: 'ee58b57b784269145d286e59cc87eb4fb5499cf2', textColor: "gray-600" }, this.notificationMessages.map(message => (index.h(index.Fragment, null, message, index.h("br", null))))), index.h("zonos-button", { key: 'a6781fde72abf7b9939e136aa5fdbbdd513a7cf5', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cart.cartStore.step === 'finish' && (index.h("div", { key: '5fd0ea2aa8f48347d027c5c7df1eb892236e7bb0', class: "zonos--finish-button-wrapper" }, index.h("zonos-button", { key: '7fdfb2af11a60f4b20b3ba083dcca1f0ac90ff56', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), index.h("zonos-button", { key: 'd627533d236a8d9cdaadce90d550984e25b64554', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
1454
1454
  }
1455
1455
  static get assetsDirs() { return ["assets"]; }
1456
1456
  };
@@ -1562,12 +1562,8 @@ const ZonosCheckoutPayment = class {
1562
1562
  this.showErrorBanner = !this.handleValidate();
1563
1563
  }
1564
1564
  const isTestMode = createCustomEvent.getIsTestMode();
1565
- const hasPaypalEnabled = paypal.paypalStoreHasPaypalEnabled();
1566
1565
  const isPaypalTabSelected = ((_a = cart.stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
1567
1566
  return (index.h(index.Host, { class: "zonos--checkout-payment zonos--elements" }, index.h("div", { class: "zonos--group" }, index.h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Payment method')), this.showErrorBanner && (index.h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, cart.translate('Missing required fields. Make sure all fields are completed.'))), cart.stripeStore.hasPaymentError && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, cart.translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypal.paypalStore.paypalErrorMessage && (index.h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypal.paypalStore.paypalErrorMessage)), index.h("zonos-payment", null), index.h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (index.h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
1568
- if (!hasPaypalEnabled) {
1569
- return;
1570
- }
1571
1567
  this.continueClickHandler();
1572
1568
  }, size: "lg",
1573
1569
  // use primary type when on mobile mode
@@ -2211,7 +2207,7 @@ const ZonosShipping = class {
2211
2207
  ...this.serviceLevelsDAP,
2212
2208
  ...this.serviceLevelsOther,
2213
2209
  ];
2214
- const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.value === ((_a = cart.cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
2210
+ const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.shipmentRatingId === ((_a = cart.cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
2215
2211
  if (selectedServiceLevel) {
2216
2212
  // keep the selected shipping method
2217
2213
  this.selectedShippingMethod = selectedServiceLevel;
@@ -2239,13 +2235,13 @@ const ZonosShipping = class {
2239
2235
  if (this.showErrorBanner) {
2240
2236
  this.showErrorBanner = !this.handleValidate();
2241
2237
  }
2242
- return (index.h(index.Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, index.h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, index.h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
2238
+ return (index.h(index.Host, { key: '9c866cd1545c3a695b449113a8dbe40560e5fe26', class: "zonos--shipping zonos--elements" }, index.h("div", { key: '7d683e7d7b2c3e25758240ac2299eac06b7f4a51', class: "zonos--group" }, index.h("zonos-text", { key: '5710e5185b2628e7793e59251073fdd8cb8cfd2e', class: "zonos--title", type: "semiBoldSubheader" }, cart.translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (index.h("zonos-banner", { key: 'afdd98898cb3305d90bfe06832a0b9f672183b47', class: "zonos--error-banner", intent: "error" }, cart.translate('No shipping method selected'))), index.h("zonos-text", { key: '07543d3f7aec9494311d3cdb38306661d5789f4a', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, cart.translate('Shipping method')), !allServiceLevels.length ? (index.h("zonos-banner", { bannerTitle: cart.translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (index.h("div", { class: "zonos--shipping-options-wrapper" }, index.h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
2243
2239
  !!this.serviceLevelsDAP.length && (index.h("button", { class: classes.classes([
2244
2240
  'zonos--shipping-options-collapse-trigger',
2245
2241
  this.collapsedDAPOptions && 'collapsed',
2246
2242
  ]), onClick: () => {
2247
2243
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
2248
- } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, index.h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
2244
+ } }, index.h("div", { class: "zonos--title-wrapper" }, index.h("zonos-text", { type: "label" }, `${cart.translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), index.h("zonos-icon", { content: ChevronUpIcon })))), index.h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, index.h("div", { class: "zonos--dap-wrapper" }, index.h("zonos-banner", { bannerTitle: cart.translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, cart.translate('You may incur additional fees from the shipping carrier by not prepaying.')), index.h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), index.h("div", { key: '7dc61c1435b40731463279f5824b60cf67e1470d', class: "zonos--group-btn" }, index.h("zonos-button", { key: 'eea4d432ad5cfb7001fcd0c7b795b2ee3ebbbac5', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
2249
2245
  // use primary type when on mobile mode
2250
2246
  variant: this.submitBtnType }, cart.translate('Go to payment'))))));
2251
2247
  }
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
7
- const paypal = require('./paypal-47b71e3b.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
+ const paypal = require('./paypal-6abc29b9.js');
8
8
  const zonosStore = require('./zonosStore-a4395972.js');
9
- const createCustomEvent = require('./createCustomEvent-3da45800.js');
9
+ const createCustomEvent = require('./createCustomEvent-68a5819f.js');
10
10
  const isCheckoutMobile = require('./isCheckoutMobile-f491ca7c.js');
11
11
  const handleFetch = require('./handleFetch-45e76490.js');
12
12
  const classes = require('./classes-b7918f56.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const handleFetch = require('./handleFetch-45e76490.js');
9
9
  require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
9
9
  const isDarkColor = require('./isDarkColor-5efc8367.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const formatStringWithLinks = require('./formatStringWithLinks-52341fc7.js');
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
- const cart = require('./cart-e15290ab.js');
7
+ const cart = require('./cart-3cc424f9.js');
8
8
  const classes = require('./classes-b7918f56.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
10
  const getHasMoreSpaceOnRight = require('./getHasMoreSpaceOnRight-4c94667f.js');
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  const index = require('./index-d56e0a8b.js');
6
- const cart = require('./cart-e15290ab.js');
6
+ const cart = require('./cart-3cc424f9.js');
7
7
  const zonosStore = require('./zonosStore-a4395972.js');
8
8
  const ILanguage = require('./ILanguage-98b04442.js');
9
9
  require('./handleFetch-45e76490.js');
@@ -5,9 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  const index = require('./index-d56e0a8b.js');
6
6
  const zonosStore = require('./zonosStore-a4395972.js');
7
7
  const classes = require('./classes-b7918f56.js');
8
- const cart = require('./cart-e15290ab.js');
8
+ const cart = require('./cart-3cc424f9.js');
9
9
  const handleFetch = require('./handleFetch-45e76490.js');
10
- const paypal = require('./paypal-47b71e3b.js');
10
+ const paypal = require('./paypal-6abc29b9.js');
11
11
  require('./isDarkColor-5efc8367.js');
12
12
  require('./getBorderRadius-5a64574c.js');
13
13
 
@@ -93,9 +93,9 @@ export class ZonosCheckoutFinish {
93
93
  };
94
94
  // TODO: This method of pulling orders is temporary. Once we have a working event registry system, we will rely on that to tell us when the order is ready to trigger onOrderSuccess
95
95
  this.getPullOrder = async (attempts = 0) => {
96
- var _a, _b, _c;
96
+ var _a, _b;
97
97
  const { baseUrl, order } = await this.pullOrder();
98
- const legacyOrderNumberExist = !!((_c = (_b = (_a = this.order) === null || _a === void 0 ? void 0 : _a.references) === null || _b === void 0 ? void 0 : _b.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _c === void 0 ? void 0 : _c.value);
98
+ const legacyOrderNumberExist = !!((_b = (_a = order === null || order === void 0 ? void 0 : order.references) === null || _a === void 0 ? void 0 : _a.find(entry => (entry === null || entry === void 0 ? void 0 : entry.key) === 'zonosOrderNumber')) === null || _b === void 0 ? void 0 : _b.value);
99
99
  // legacy customers are still using the old order number so we need to wait for legacy order number to attach to dgs order before redirecting
100
100
  if ((order && attempts >= 5) || legacyOrderNumberExist) {
101
101
  if (!legacyOrderNumberExist) {
@@ -251,11 +251,11 @@ export class ZonosCheckoutFinish {
251
251
  var _a, _b;
252
252
  const orderId = ((_a = this.order) === null || _a === void 0 ? void 0 : _a.accountOrderNumber) || getGraphQlShortId((_b = this.order) === null || _b === void 0 ? void 0 : _b.id);
253
253
  const isTestMode = getIsTestMode();
254
- return (h(Host, { key: '3c6c69c59622b7b2731f9bc6eb1cc8a7f3491572', class: "zonos--checkout-finish zonos--elements", style: {
254
+ return (h(Host, { key: 'b39124e58c4b12acbd7b29290808248298239e9c', class: "zonos--checkout-finish zonos--elements", style: {
255
255
  '--border-radius': getBorderRadius({
256
256
  overrideBorderStyle: this.borderRadius,
257
257
  }),
258
- } }, this.isLoading && (h("div", { key: '45ce0e608dca725237abc09295656c8b6471d26c', class: "loading-wrapper" }, h("zonos-spinner", { key: 'fd1a193d34ecf41af9bb6eff082c192c6a8d46db' }))), !this.isLoading && (h("div", { key: '64f652a419330967f13b9d01a172fcc52f6dfd5b', class: "zonos--finish-details" }, h("div", { key: '945cb9e55b418de79921c1995604572e6e009459', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '241bd7034c5ab5e83e4cedd526a181120a743ad0', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("div", { key: '959595c1be3f65aa6cd2e00e4398c5bb4df702b6', class: "zonos--order-number" }, "Order #", orderId)), h("zonos-text", { key: 'a23dce69391c3abf49eb512e715af454c971977e', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: 'ce87734e2d46e8a044bc0ded7a6ed6a4a705685d', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: 'a46cee8819c83fb76a54dbe049ee2452b7fc150a', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '514fdff77f5aff9f4b9657a0579ab843833af7b0', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: '59630cf7504c1ef9d24854d041b063bbfdc3a1a4', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
258
+ } }, this.isLoading && (h("div", { key: 'e63389c86a1bb0c405e7ae3c852fc1c966320f50', class: "loading-wrapper" }, h("zonos-spinner", { key: '0caff7b42ab138ad47f4683ea9641b2fef75f714' }))), !this.isLoading && (h("div", { key: 'e305f1c720418a22a376807f17413fa97688af86', class: "zonos--finish-details" }, h("div", { key: 'dced8dc9e0a7ae68e4bfa6b00d841ba4eae9e1f3', class: "zonos--group" }, this.notificationType === 'success' ? (h("zonos-icon", { "aria-label": "Order success", content: SuccessIcon, iconColor: 'blue-800', size: 50 })) : (h("zonos-icon", { "aria-label": "Order failed", content: RemoveIcon, iconColor: 'red-800', size: 50 })), h("zonos-text", { key: '343dade4f02efe9c9fdc4c8087b725f2d4e39177', class: "zonos--title", type: "semiBoldSubheader" }, this.notificationTitle), orderId && (h("div", { key: 'aa715a39e3126d7cb108c447fb2eb586279fc768', class: "zonos--order-number" }, "Order #", orderId)), h("zonos-text", { key: 'ee58b57b784269145d286e59cc87eb4fb5499cf2', textColor: "gray-600" }, this.notificationMessages.map(message => (h(Fragment, null, message, h("br", null))))), h("zonos-button", { key: 'a6781fde72abf7b9939e136aa5fdbbdd513a7cf5', onClick: () => this.closeClickHandler(), size: "md", variant: "primary" }, this.notificationActionText)), isTestMode && cartStore.step === 'finish' && (h("div", { key: '5fd0ea2aa8f48347d027c5c7df1eb892236e7bb0', class: "zonos--finish-button-wrapper" }, h("zonos-button", { key: '7fdfb2af11a60f4b20b3ba083dcca1f0ac90ff56', backgroundColor: "gray-0", buttonColor: "gray-1200", onClick: () => this.closeClickHandler(), size: "lg", variant: "outline" }, "New test cart"), h("zonos-button", { key: 'd627533d236a8d9cdaadce90d550984e25b64554', onClick: () => this.redirectToUrl(`/orders/all`), size: "lg", variant: "primary" }, "View order in Dashboard")))))));
259
259
  }
260
260
  static get is() { return "zonos-checkout-finish"; }
261
261
  static get encapsulation() { return "shadow"; }
@@ -1,6 +1,6 @@
1
1
  import { h, Host, } from "@stencil/core";
2
2
  import { cartStore } from "../../../store/checkout/cart";
3
- import { paypalStore, paypalStoreHasPaypalEnabled, } from "../../../store/checkout/paypal";
3
+ import { paypalStore } from "../../../store/checkout/paypal";
4
4
  import { stripeStore } from "../../../store/checkout/stripe";
5
5
  import { translate } from "../../../store/translationStore";
6
6
  import { getIsTestMode } from "../../../utils/checkout/getIsTestMode";
@@ -51,12 +51,8 @@ export class ZonosCheckoutPayment {
51
51
  this.showErrorBanner = !this.handleValidate();
52
52
  }
53
53
  const isTestMode = getIsTestMode();
54
- const hasPaypalEnabled = paypalStoreHasPaypalEnabled();
55
54
  const isPaypalTabSelected = ((_a = stripeStore.stripePaymentEventData) === null || _a === void 0 ? void 0 : _a.value.type) === 'external_paypal';
56
55
  return (h(Host, { class: "zonos--checkout-payment zonos--elements" }, h("div", { class: "zonos--group" }, h("zonos-text", { class: "zonos--title", type: "semiBoldSubheader" }, translate('Payment method')), this.showErrorBanner && (h("zonos-banner", { class: "zonos--error-banner", intent: "error" }, translate('Missing required fields. Make sure all fields are completed.'))), stripeStore.hasPaymentError && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, translate("We couldn't complete your payment. Please verify the payment details and try again."))), paypalStore.paypalErrorMessage && (h("zonos-banner", { class: "zonos--payment-error-banner", intent: "error" }, paypalStore.paypalErrorMessage)), h("zonos-payment", null), h("div", { class: "zonos--group-btn" }, !isPaypalTabSelected && (h("zonos-button", { backgroundColor: this.submitBtnColor, loading: this.continueLoading, onClick: () => {
57
- if (!hasPaypalEnabled) {
58
- return;
59
- }
60
56
  this.continueClickHandler();
61
57
  }, size: "lg",
62
58
  // use primary type when on mobile mode
@@ -118,7 +118,7 @@ export class ZonosShipping {
118
118
  ...this.serviceLevelsDAP,
119
119
  ...this.serviceLevelsOther,
120
120
  ];
121
- const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.value === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
121
+ const selectedServiceLevel = allServiceLevels.find(item => { var _a; return item.shipmentRatingId === ((_a = cartStore.selectedShippingOption) === null || _a === void 0 ? void 0 : _a.id); }) || null;
122
122
  if (selectedServiceLevel) {
123
123
  // keep the selected shipping method
124
124
  this.selectedShippingMethod = selectedServiceLevel;
@@ -146,13 +146,13 @@ export class ZonosShipping {
146
146
  if (this.showErrorBanner) {
147
147
  this.showErrorBanner = !this.handleValidate();
148
148
  }
149
- return (h(Host, { key: 'e376545666893a373bca1591083a868892804fb1', class: "zonos--shipping zonos--elements" }, h("div", { key: 'f8901d3d8fbeb6a285a7a33b9cea940476413c68', class: "zonos--group" }, h("zonos-text", { key: '83e02010c5e11647064ebf28468def163dd3395a', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'e65f0ce2e968612bd7c1efeca8309e69a03a8c65', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: 'cdae794614c6879477e96de435d5c4e59f469fe9', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
149
+ return (h(Host, { key: '9c866cd1545c3a695b449113a8dbe40560e5fe26', class: "zonos--shipping zonos--elements" }, h("div", { key: '7d683e7d7b2c3e25758240ac2299eac06b7f4a51', class: "zonos--group" }, h("zonos-text", { key: '5710e5185b2628e7793e59251073fdd8cb8cfd2e', class: "zonos--title", type: "semiBoldSubheader" }, translate('Delivery options')), this.showErrorBanner && !!allServiceLevels.length && (h("zonos-banner", { key: 'afdd98898cb3305d90bfe06832a0b9f672183b47', class: "zonos--error-banner", intent: "error" }, translate('No shipping method selected'))), h("zonos-text", { key: '07543d3f7aec9494311d3cdb38306661d5789f4a', class: "zonos--shipping-method-title", type: "semiBoldLabel" }, translate('Shipping method')), !allServiceLevels.length ? (h("zonos-banner", { bannerTitle: translate('No shipping methods found - please review and update your address details by selecting the "Customer" tab above. If you continue to encounter issues, contact our support team for assistance.'), class: "zonos--shipping-method-error", intent: "error" })) : (h("div", { class: "zonos--shipping-options-wrapper" }, h("zonos-shipping-rich-radio", { items: defaultShownServiceLevels, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }), !!defaultShownServiceLevels.length &&
150
150
  !!this.serviceLevelsDAP.length && (h("button", { class: classes([
151
151
  'zonos--shipping-options-collapse-trigger',
152
152
  this.collapsedDAPOptions && 'collapsed',
153
153
  ]), onClick: () => {
154
154
  this.collapsedDAPOptions = !this.collapsedDAPOptions;
155
- } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '2dded1f7168a16ed6432ea0b147b8ec78fd774a6', class: "zonos--group-btn" }, h("zonos-button", { key: '54c05db9336209c34a7c7c518bbdf859e97b51f1', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
155
+ } }, h("div", { class: "zonos--title-wrapper" }, h("zonos-text", { type: "label" }, `${translate(this.collapsedDAPOptions ? 'Show non-prepaid options' : 'Hide non-prepaid options')} `), h("zonos-icon", { content: ChevronUpIcon })))), h("zonos-collapse", { collapsed: this.collapsedDAPOptions }, h("div", { class: "zonos--dap-wrapper" }, h("zonos-banner", { bannerTitle: translate('Duties and taxes will be charged upon delivery.'), intent: "warning" }, translate('You may incur additional fees from the shipping carrier by not prepaying.')), h("zonos-shipping-rich-radio", { items: this.serviceLevelsDAP, onRadioSelected: e => this.handleRadioSelected(e), selectedItem: this.selectedShippingMethod }))))), h("div", { key: '7dc61c1435b40731463279f5824b60cf67e1470d', class: "zonos--group-btn" }, h("zonos-button", { key: 'eea4d432ad5cfb7001fcd0c7b795b2ee3ebbbac5', backgroundColor: this.submitBtnColor, loading: this.continueLoading || this.isSelecting, onClick: () => this.continueClickHandler(), size: "lg",
156
156
  // use primary type when on mobile mode
157
157
  variant: this.submitBtnType }, translate('Go to payment'))))));
158
158
  }
@@ -1,5 +1,5 @@
1
1
  import { createStore } from "@stencil/store";
2
- import { stripeStore, stripeStoreReset, stripeStoreUpdateCheckoutSession, } from "./stripe";
2
+ import { stripeStore, stripeStoreInitCheckoutSession, stripeStoreReset, stripeStoreUpdateCheckoutSession, } from "./stripe";
3
3
  import { localizationStore } from "../hello/localization";
4
4
  import { translate } from "../translationStore";
5
5
  import { log } from "../../utils/logging/log";
@@ -170,7 +170,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
170
170
  cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
171
171
  }
172
172
  };
173
- const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
173
+ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
174
174
  var _a;
175
175
  if (landedCostId && cartStore.selectedLandedCost) {
176
176
  // update cart total right away if we have landed cost id to avoid order total flickering
@@ -184,7 +184,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
184
184
  }
185
185
  // update checkout session
186
186
  if (!cartStore.checkoutSessionId) {
187
- logError('Could not update cart total without checkout session id');
187
+ log('Could not update cart total without checkout session id', 'info');
188
188
  return false;
189
189
  }
190
190
  const { errors, json } = await stripeStoreUpdateCheckoutSession({
@@ -198,13 +198,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
198
198
  });
199
199
  if (errors.length > 0 || !json) {
200
200
  // do nothing if we can't get checkout session
201
- logError('Error occurs when updating checkout session');
202
- cartStoreUpdateToErrorState({
203
- messages: [
204
- translate("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists"),
205
- ],
206
- title: translate('Error updating Checkout'),
207
- });
201
+ logError('Error occurs when updating checkout session.');
202
+ if (shouldInitSessionOnFailure) {
203
+ log('Initiating checkout session on failure', 'info');
204
+ const success = await stripeStoreInitCheckoutSession();
205
+ log(`stripeStoreInitCheckoutSession: ${success}`);
206
+ if (!success) {
207
+ return false;
208
+ }
209
+ return true;
210
+ }
208
211
  return false;
209
212
  }
210
213
  if (!landedCostId) {
@@ -322,6 +325,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
322
325
  currency: currency,
323
326
  dutiesTaxesFeesEstimate: 0,
324
327
  itemsAmount: total,
328
+ // attempt to init session on failure to update checkout session
329
+ shouldInitSessionOnFailure: true,
325
330
  });
326
331
  stripeStore.isFetchingSession = false;
327
332
  };
@@ -9824,7 +9824,7 @@ const cartStoreSetCheckoutSession = (checkoutSession) => {
9824
9824
  cartStore.externalConfirmationPageURL = externalConfirmationPageURL;
9825
9825
  }
9826
9826
  };
9827
- const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, }) => {
9827
+ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency, dutiesTaxesFeesEstimate, itemsAmount, landedCostId, shouldInitSessionOnFailure, }) => {
9828
9828
  var _a;
9829
9829
  if (landedCostId && cartStore.selectedLandedCost) {
9830
9830
  // update cart total right away if we have landed cost id to avoid order total flickering
@@ -9838,7 +9838,7 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
9838
9838
  }
9839
9839
  // update checkout session
9840
9840
  if (!cartStore.checkoutSessionId) {
9841
- logError('Could not update cart total without checkout session id');
9841
+ log('Could not update cart total without checkout session id', 'info');
9842
9842
  return false;
9843
9843
  }
9844
9844
  const { errors, json } = await stripeStoreUpdateCheckoutSession({
@@ -9852,13 +9852,16 @@ const cartStoreReCalculateTotal = async ({ adjustmentsAmount, cartId, currency,
9852
9852
  });
9853
9853
  if (errors.length > 0 || !json) {
9854
9854
  // do nothing if we can't get checkout session
9855
- logError('Error occurs when updating checkout session');
9856
- cartStoreUpdateToErrorState({
9857
- messages: [
9858
- translate("There's been an error updating your checkout session. Please reload and try again or contact support if the error persists"),
9859
- ],
9860
- title: translate('Error updating Checkout'),
9861
- });
9855
+ logError('Error occurs when updating checkout session.');
9856
+ if (shouldInitSessionOnFailure) {
9857
+ log('Initiating checkout session on failure', 'info');
9858
+ const success = await stripeStoreInitCheckoutSession();
9859
+ log(`stripeStoreInitCheckoutSession: ${success}`);
9860
+ if (!success) {
9861
+ return false;
9862
+ }
9863
+ return true;
9864
+ }
9862
9865
  return false;
9863
9866
  }
9864
9867
  if (!landedCostId) {
@@ -9976,6 +9979,8 @@ const cartStoreUpdateItems = async ({ adjustments, cartItems, }) => {
9976
9979
  currency: currency,
9977
9980
  dutiesTaxesFeesEstimate: 0,
9978
9981
  itemsAmount: total,
9982
+ // attempt to init session on failure to update checkout session
9983
+ shouldInitSessionOnFailure: true,
9979
9984
  });
9980
9985
  stripeStore.isFetchingSession = false;
9981
9986
  };
@@ -1,4 +1,4 @@
1
- import { d as cartStore, l as localizationStore } from './cart-08c2a740.js';
1
+ import { d as cartStore, l as localizationStore } from './cart-66d67627.js';
2
2
  import { z as zonosStore } from './zonosStore-0dc7a947.js';
3
3
  import { h as handleFetch } from './handleFetch-0133265e.js';
4
4
 
package/dist/esm/index.js CHANGED
@@ -94,7 +94,7 @@ const getZonosQaUrl = () => {
94
94
  return null;
95
95
  }
96
96
  const qaUrl = extractZonosQaUrl(window.location.href);
97
- const cdnUrl = "https://v1.3.89.js.zonos.com";
97
+ const cdnUrl = "https://v1.3.91.js.zonos.com";
98
98
  // when the qaUrl is not set and the built URL is from the test domain, use the test domain for testing
99
99
  if (!qaUrl &&
100
100
  (cdnUrl.includes('test.') ||
@@ -278,10 +278,10 @@ const zonosLoadUrl = (() => {
278
278
  }
279
279
  return null;
280
280
  })();
281
- const ZONOS_URL = "https://v1.3.89.js.zonos.com";
282
- const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.89";
283
- const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.89";
284
- const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.89";
281
+ const ZONOS_URL = "https://v1.3.91.js.zonos.com";
282
+ const JS_DELIVR_ZONOS_URL = zonosLoadUrl || "https://cdn.jsdelivr.net/npm/@zonos/elements@1.3.91";
283
+ const UNPKG_ZONOS_URL = "https://unpkg.com/@zonos/elements@1.3.91";
284
+ const CDNJS_ZONOS_URL = "https://cdnjs.cloudflare.com/ajax/libs/zonos-elements/1.3.91";
285
285
  const INTER_FONT_URL = 'https://rsms.me';
286
286
  const GOOGLE_FONT_URL = 'https://fonts.googleapis.com';
287
287
  const INTER_FONT_REGEX = /^https:\/\/rsms\.me\/inter\/inter\.css(.*)$/;
@@ -296,7 +296,7 @@ Zonos.zonosConversionTest = typeof window !== 'undefined' &&
296
296
  !!window.location.search.match(/\?.*(&*)zonosConversionTest/);
297
297
  Zonos._paypalMockResponse = null;
298
298
  Zonos.isBigCommerce = false;
299
- Zonos.releaseDate = "1728924518080";
299
+ Zonos.releaseDate = "1728930718892";
300
300
  Zonos.isLegacyCheckout = false;
301
301
  /**
302
302
  * By default, the package will load from npm
@@ -304,7 +304,7 @@ Zonos.isLegacyCheckout = false;
304
304
  Zonos.isNpm = true;
305
305
  Zonos.zonosQaUrl = null;
306
306
  Zonos.zonosQaUrlApi = null;
307
- Zonos.version = `v${"1.3.89"}`;
307
+ Zonos.version = `v${"1.3.91"}`;
308
308
  Zonos.modeAlerted = false;
309
309
  Zonos.cartData = null;
310
310
  Zonos.paypal = null;
@@ -1,5 +1,5 @@
1
1
  import { z as zonosStore, c as createStore } from './zonosStore-0dc7a947.js';
2
- import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-08c2a740.js';
2
+ import { d as cartStore, r as stripeStoreHandleInventoryCheck, t as translate, q as cartStoreNextStep, h as cartStoreClearCheckoutInterval } from './cart-66d67627.js';
3
3
  import { h as handleFetch, l as log, a as logError, j as jsonParse } from './handleFetch-0133265e.js';
4
4
  import { t as tinycolor } from './isDarkColor-b3afa948.js';
5
5
 
@@ -446,8 +446,5 @@ const paypalStoreInitButtons = (props) => {
446
446
  .filter(Boolean);
447
447
  return paypalStore.paypalButtons;
448
448
  };
449
- const paypalStoreHasPaypalEnabled = () => {
450
- return !!paypalStore.paypalButtons.length;
451
- };
452
449
 
453
- export { paypalStore as a, paypalStoreReset as b, paypalStoreHasPaypalEnabled as c, paypalStoreInitButtons as d, isContrastColor as i, paypalInitScript as p, submitGtag as s };
450
+ export { paypalStore as a, paypalStoreReset as b, paypalStoreInitButtons as c, isContrastColor as i, paypalInitScript as p, submitGtag as s };
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, c as createEvent, h, H as Host, d as getElement } from './index-86b8247e.js';
2
- import { j as stripeStore, P as getFallbackDefaultCountryCode, l as localizationStore, t as translate } from './cart-08c2a740.js';
2
+ import { j as stripeStore, P as getFallbackDefaultCountryCode, l as localizationStore, t as translate } from './cart-66d67627.js';
3
3
  import { i as isCheckoutMobile } from './isCheckoutMobile-8846dccb.js';
4
4
  import { a as logError, l as log } from './handleFetch-0133265e.js';
5
5
  import { i as isTextContainsNonLatinChars, c as containsNonLatinChars } from './containsNonLatinChars-2d8810c3.js';